Fastreport inside components execpt Exeption. Delphi 7.0

edited July 2009 in FastReport 4.0
Dear...,

I implemented the Fastreport-components inside another (comp.blp).
requires
...
frx7,
fs7,
fqb70,
frxe7;

This new component is used at different positions (*.dll) inside the projects.

The applications is running, no problem.

By closing the application all modules (*.dll) will destroy. The Result: Access violation at.... [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> The Fastreport is used over a pointer of an object. I'm testing, that the pointer is <> nil.[/img][img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> I've gotten this probleme, in the moment of implementation of frx7, fs7, fqb70, frxe7 (requires....) inside comp.bpl. (Only: Use.... and Require....) Are there some ideas?[/img]>

Comments

  • dschuchdschuch Dresden,Germany
    edited 11:21AM
    I think your pointer is wrong.

    Perhaps your FR-Component is destroyed at another point (Owner Component Destroy) already but your pointer is not cleared there.

    Try: In OnDestroy of your FR-Component set your global pointer to nil.


    saxy wrote: »
    By closing the application all modules (*.dll) will destroy. The Result: Access violation at.... [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> The Fastreport is used over a pointer of an object. I'm testing, that the pointer is <> nil.[/img][img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> Are there some ideas?[/img]>
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 11:21AM
    No matter how many objects you create and assign to the TfrxReport object in your code, you should only destroy your TfrxReport, as it internally will destroy all of its children, regardless if it was created by you (by code) or from a template (dfm, FR3 file).
  • edited July 2009
    Hey dschuch

    Is allready done. Wasn't the probleme.
  • dschuchdschuch Dresden,Germany
    edited 11:21AM
    do you know ehere exactly the exception is raised? do you have the code line?
  • edited 11:21AM
    dschuch wrote: »
    do you know ehere exactly the exception is raised? do you have the code line?

    At the posisition of exception, there is an module=nil. But without FR this module isn't nil, also if I don't use FR in different modules.

    At the moment I use a "headache tablet" means if(mod<>nil) then....

    What I'm looking for is die reasone of the problem.

    Codelines:
    if Count > 0 then begin
    while ix < Count do begin
    moddef := Items[ix] ;
    if(moddef<>nil) then begin
    if moddef.Instance = hinst then begin
    result := moddef.Name ;
    Exit ;
    end ;
    end;
    Inc ( ix ) ;
    end
    ...
  • edited 11:21AM
    No matter how many objects you create and assign to the TfrxReport object in your code, you should only destroy your TfrxReport, as it internally will destroy all of its children, regardless if it was created by you (by code) or from a template (dfm, FR3 file).


    An possible explaination: Different modules use the pointer of the allocated globel member of the FR-Container. At the application finishing every modules will destroy. The first module finds the FR by the pointer, so that FR will also destroy. At the destroying of the second module, the FR is missing and .... access violation.

    Now, I use the headache tablet...

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.